class window.WinScreen extends Screen
    setLast : (@lastScreen) ->
        @font = @lastScreen.font
        @cooldown = 100

    update : () ->
        @cooldown -= 1
        if window.Input.any.isDown() and @cooldown < 0
            @screenGoBack()
    render : () ->
        g = @lastScreen
        @font.drawString -380, -150, "You managed to escape!", 4.0
        @font.drawString -225 + 50 * Math.sin(Date.now() / 1000.0), -110, "Press any key to restart", 2.0
        @font.drawString -380, -90, "statistics: ", 2.0

        if g.killCount == 0
            @font.drawString -380, -70, "You killed no guards (Nice!)", 2.0
        else
            @font.drawString -380, -70, "You killed " + g.killCount + " guards", 2.0

        if g.alertedGuardsCount == 0
            @font.drawString -380, -50, "You didn't alert any guards (Are you a ninja?)", 2.0
        else
            @font.drawString -380, -50, "You trigged the alert #{g.alertedGuardsCount} times", 2.0

        if g.unnoticed
            @font.drawString -380, -30, "You managed to escape unnoticed!", 2.0
            @font.drawString -380, -10, "you're way better than me :)", 2.0
        
        @font.drawString -380, 30, "I hope you enjoyed my first Ludum Dare game", 2.0
        @font.drawString -380, 50, "The game has a lot of quirks, and I am sorry if", 2.0
        @font.drawString -380, 70, "you had to endure them..", 2.0
        @font.drawString -380, 100, "Thanks for playing!", 2.0
        


        
